<div>
    <div class="meta-section">
        <div class="meta-section-header">
            <h4 class="meta-section-header-title">控制面板</h4>
        </div>
        <div class="meta-section-container">
            <uib-tabset>
                <uib-tab heading="操作">
                    <div class="meta-secondary-section">
                        <div class="meta-secondary-section-header">
                            <i class="fa fa-user"></i><span>委派操作</span>

                            <p class="meta-status meta-adjust-status" ng-class="{
                              'meta-online-status': editCtrl.data.isAssigned,
                              'meta-offline-status': !editCtrl.data.isAssigned}">
                                {{editCtrl.data.isAssigned?'已委派':'未委派'}}
                            </p>
                        </div>
                        <div class="meta-secondary-section-content">
                            <div class="meta-input-section">
                                <span class="meta-input-section-title">项目经理: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-input">
                                        <ui-select ng-model="editCtrl.manager" theme="bootstrap">
                                            <ui-select-match class="ui-select-match" placeholder="选择项目经理">
                                                {{editCtrl.manager}}
                                            </ui-select-match>
                                            <ui-select-choices class="ui-select-choices"
                                                               repeat="element in managerOptions | filter:$select.search track by $index">
                                                {{element}}
                                            </ui-select-choices>
                                        </ui-select>
                                    </div>
                                </div>
                            </div>
                            <div class="meta-input-section">
                                <span class="meta-input-section-title">负责人类别: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-input">
                                        <ui-select ng-model="editCtrl.type" theme="bootstrap"
                                                   ng-change="updateLeader()">
                                            <ui-select-match class="ui-select-match" placeholder="选择类别">
                                                {{editCtrl.type}}
                                            </ui-select-match>
                                            <ui-select-choices class="ui-select-choices"
                                                               repeat="element in editCtrl.typeOptions | filter:$select.search track by $index">
                                                {{element}}
                                            </ui-select-choices>
                                        </ui-select>
                                    </div>
                                </div>
                            </div>
                            <div class="meta-input-section">
                                <span class="meta-input-section-title">负责人姓名: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-text">{{leaderCandidate}}</div>
                                </div>
                            </div>
                            <div class="meta-input-section">
                                <button class="btn btn-info meta-three-buttons"
                                        ng-click="openModel('lg','views/permission/modal/user.html', 'PartnerModelCtrl', {type: 'leader'})"
                                        ng-disabled="(editCtrl.type!='合伙人')">
                                    查看
                                </button>
                                <button class="btn btn-success meta-three-buttons"
                                        ng-click="openModel('sm','views/permission/modal/confirm.html', 'AssignModelCtrl', {name: editCtrl.manager}, 0)">
                                    委派
                                </button>
                                <button class="btn btn-warning meta-three-buttons" style="margin-right:0;"
                                        ng-click="resetAssign()">
                                    重置
                                </button>
                            </div>
                        </div>
                    </div>
                    <div class="meta-secondary-section">
                        <div class="meta-secondary-section-header">
                            <i class="fa fa-book"></i><span>审核操作</span>

                            <p class="meta-status meta-adjust-status meta-offline-status"
                               ng-class="{'meta-online-status': editCtrl.data.hasVerified}">
                                {{editCtrl.data.hasVerified? '审核者:' + editCtrl.data.verifier.name:'未审核'}}
                            </p>
                        </div>
                        <div class="meta-secondary-section-content">
                            <div class="meta-input-section">
                                <span class="meta-input-section-title">审核状态: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-text">
                                        {{editCtrl.data.state}}
                                    </div>
                                </div>
                            </div>
                            <div class="meta-input-section">
                                <button class="btn btn-info meta-three-buttons" ng-disabled="editCtrl.data.state!='新提交'"
                                        ng-click="openModel('sm','views/permission/modal/confirm.html', 'VerifiedModelCtrl', {'module': 'demand', 'verified': false, 'state': '审核中'})">
                                    开始审核
                                </button>
                                <button class="btn btn-success meta-three-buttons"
                                        ng-disabled="editCtrl.data.state!='审核中'"
                                        ng-click="openModel('sm','views/permission/modal/confirm.html', 'VerifiedModelCtrl', {'module': 'demand', 'verified': true, 'state': '征集中'})">
                                    审核通过
                                </button>
                                <button class="btn btn-danger meta-three-buttons"
                                        ng-disabled="editCtrl.data.state!='审核中'"
                                        ng-click="openModel('sm','views/permission/modal/confirm.html', 'VerifiedModelCtrl', {'module': 'demand', 'verified': false, 'state': '不通过'})">
                                    审核拒绝
                                </button>
                            </div>
                        </div>
                    </div>
                    <div class="meta-secondary-section meta-last">
                        <div class="meta-secondary-section-header">
                            <i class="fa fa-edit"></i><span>其他操作</span>
                        </div>
                        <div class="meta-secondary-section-content">
                            <div class="meta-input-section">
                                <button class="btn meta-three-buttons"
                                        ng-class="{true: 'btn-success', false: 'btn-warning'}[editCtrl.data.rank==0]"
                                        ng-click="changeControlState('rank')">{{editCtrl.data.rank == 0 ? '推荐' :
                                    '取消推荐'}}
                                </button>
                                <a class="btn btn-success meta-three-buttons"
                                   ng-href="{{CONFIG.API_HOST+'/demands/'+editCtrl.data.id+'/download'}}">下载</a>
                                <button class="btn meta-three-buttons"
                                        ng-class="{true: 'btn-danger', false: 'btn-success'}[editCtrl.data.online==true]"
                                        ng-click="changeControlState('online')">{{editCtrl.data.online==true?'保密':'公开'}}
                                </button>
                            </div>
                            <div class="meta-input-section">
                                <button class="btn btn-info meta-three-buttons"
                                        ng-click="openModel('sm','views/permission/modal/state.html', 'StateModelCtrl', {'module': 'demand', 'state': editCtrl.data.state})">
                                    修改状态
                                </button>
                                <a class="btn btn-info meta-three-buttons"
                                   ng-href="{{CONFIG.frontHost + '/demand/' + editCtrl.data.id}}"
                                   target="_blank">线上预览</a>
                            </div>
                        </div>
                    </div>
                </uib-tab>
                <uib-tab heading="信息">
                    <div class="meta-secondary-section">
                        <div class="meta-secondary-section-header">
                            <i class="fa fa-th-list"></i><span>基本信息</span>
                        </div>
                        <div class="meta-secondary-section-content">
                            <div class="meta-input-section meta-short">
                                <span class="meta-input-section-title">状态: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-text">
                                        {{editCtrl.data.state}}
                                    </div>
                                </div>
                            </div>
                            <div class="meta-input-section meta-short">
                                <span class="meta-input-section-title">下载量: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-text">
                                        {{editCtrl.data.downloads}}
                                    </div>
                                </div>
                                <div class="clear-float"></div>
                            </div>
                            <div class="meta-input-section meta-short">
                                <span class="meta-input-section-title">游览量: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-text">
                                        {{editCtrl.data.pageViews}}
                                    </div>
                                </div>
                                <div class="clear-float"></div>
                            </div>
                            <div class="meta-input-section meta-short">
                                <span class="meta-input-section-title">真实下载量: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-text">
                                        {{editCtrl.data.downloads -
                                        (editCtrl.data.extraDownloads?editCtrl.data.extraDownloads:0) }}
                                    </div>
                                </div>
                                <div class="clear-float"></div>
                            </div>
                            <div class="meta-input-section meta-short">
                                <span class="meta-input-section-title">真实游览量: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-text">
                                        {{editCtrl.data.pageViews -
                                        (editCtrl.data.extraPageViews ? editCtrl.data.extraPageViews : 0)}}
                                    </div>
                                </div>
                                <div class="clear-float"></div>
                            </div>
                            <div class="meta-input-section meta-short">
                                <span class="meta-input-section-title">收藏量: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-text">
                                        暂无接口
                                    </div>
                                </div>
                                <div class="clear-float"></div>
                            </div>
                            <div class="meta-input-section meta-short">
                                <span class="meta-input-section-title">关注度: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-text">
                                        暂无接口
                                    </div>
                                </div>
                                <div class="clear-float"></div>
                            </div>
                            <div class="meta-input-section meta-short">
                                <span class="meta-input-section-title">提交时间: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-text">
                                        {{editCtrl.data.createdAt | date:"yyyy-MM-dd HH:mm"}}
                                    </div>
                                </div>
                                <div class="clear-float"></div>
                            </div>
                            <div class="meta-input-section meta-short">
                                <span class="meta-input-section-title">审核时间: </span>

                                <div class="meta-input-section-control">
                                    <div class="meta-text">
                                        {{editCtrl.data.verifiedAt==null?'还未审核':(editCtrl.data.verifiedAt |
                                        date:"yyyy-MM-dd HH:mm")}}
                                    </div>
                                </div>
                                <div class="clear-float"></div>
                            </div>
                        </div>
                    </div>
                </uib-tab>
                <uib-tab heading="备注">
                    <div class="tab-comment" ng-show='!controlTab' ui-view="comment"></div>
                </uib-tab>
            </uib-tabset>
        </div>
    </div>
</div>
